program engine;

uses CoreI{$IFDEF MSWINDOWS}, windows{$endif};
function ErrorHandler(var message:PChar; code:cardinal):boolean; cdecl;
begin
result:=false;
log_write(PChar('Unhandled error in core: ' + message), ll_critical);
{$ifdef MSWINDOWS}
MessageBox(0, message, 'Critical Error', MB_IconError);
{$endif}
halt;
end;
   begin
Core_RegisterErrorHandler(@ErrorHandler);
core_init;
core_main;
core_close;
end.
